package examples
{
	import flash.display.*;
	import flash.events.*;
	
	[SWF(width="800",height="600",frameRate="60",backgroundColor="#FFffff")]
	public class Template extends Sprite
	{
		/// 构造函数
		public function Template()
		{
			super()
			stage.addEventListener(Event.ENTER_FRAME, init)
		}
		
		/// 初始化
		protected function init(e : Event) : void
		{
			stage.align = StageAlign.TOP_LEFT
			stage.scaleMode = "noScale"
			stage.removeEventListener(Event.ENTER_FRAME, init);
			stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
		}
		
		/// enterFrame 事件
		protected function onEnterFrame(e : Event) : void
		{
		
		}
		
		/// 鼠标移动事件
		private function onMouseMove(e : MouseEvent) : void
		{
			stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove)
			stage.addEventListener(Event.MOUSE_LEAVE, onMouseLeave);
			stage.addEventListener(Event.ENTER_FRAME, onEnterFrame)
		}
		
		/// 鼠标移出事件
		private function onMouseLeave(e : Event) : void
		{
			stage.removeEventListener(Event.MOUSE_LEAVE, onMouseLeave);
			stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
			stage.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
		
		}
	}
}